/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.poll.information.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.hopes.bizz.common.core.util.StringUtils;
import com.hopes.bizz.poll.common.constant.enums.PollSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 企业信息
 *
 * @author cx
 * @date 2023-09-18 14:31:59
 */
@Data
@TableName("poll_enterprise")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "企业信息")
public class PollEnterpriseEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

 
	/**
	* id
	*/
	@JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="id")
    private Long id;

	/**
	* 乡镇
	*/
    @Schema(description="乡镇")
    private String township;

	/**
	* 企业名称
	*/
    @Schema(description="企业名称")
    private String enterpriseName;

	/**
	* 排污许可
	*/
    @Schema(description="排污许可")
    private Integer dischargePermit;

	/**
	* 企业简称
	*/
    @Schema(description="企业简称")
    private String enterpriseAbbreviation;

	/**
	* 所在园区
	*/
    @Schema(description="所在园区")
    private String park;

	/**
	* 统一社会信用代码
	*/
    @Schema(description="统一社会信用代码")
    private String usci;

	/**
	* 区、县行政编码
	*/
    @Schema(description="区、县行政编码")
    private String administrativeCode;

	/**
	* 注册类型
	*/
    @Schema(description="注册类型")
    private String registrationType;

	/**
	* 注册资金
	*/
    @Schema(description="注册资金")
    private String registeredCapital;

	/**
	* 行业类别
	*/
    @Schema(description="行业类别")
    private String industryCategory;

	/**
	* 企业性质
	*/
    @Schema(description="企业性质")
    private String enterpriseNature;

	/**
	* 企业规模
	*/
    @Schema(description="企业规模")
    private String scale;

	/**
	* 隶属关系
	*/
    @Schema(description="隶属关系")
    private String membership;

	/**
	* 法人代码
	*/
    @Schema(description="法人代码")
    private String legalCode;

	/**
	* 法定代表人
	*/
    @Schema(description="法定代表人")
    private String legalRepresentative;

	/**
	* 开户行
	*/
    @Schema(description="开户行")
    private String bank;

	/**
	* 银行账号
	*/
    @Schema(description="银行账号")
    private String bankAccount;

	/**
	* 投产日期
	*/
    @Schema(description="投产日期")
    private LocalDateTime productionDate;

	/**
	* 企业网址
	*/
    @Schema(description="企业网址")
    private String enterpriseWebsite;

	/**
	* 办公电话
	*/
    @Schema(description="办公电话")
    private String officePhone;

	/**
	* 传真
	*/
    @Schema(description="传真")
    private String portraiture;

	/**
	* 移动电话
	*/
    @Schema(description="移动电话")
    private String telephone;

	/**
	* 电子邮件
	*/
    @Schema(description="电子邮件")
    private String eMail;

	/**
	* 邮政编码
	*/
    @Schema(description="邮政编码")
    private String zipCode;

	/**
	* 通讯编码
	*/
    @Schema(description="通讯编码")
    private String communicationCode;

	/**
	* 占地面积
	*/
    @Schema(description="占地面积")
    private String floorSpace;

	/**
	* 员工数
	*/
    @Schema(description="员工数")
    private Integer employeesNumber;

	/**
	* 生产经营地址
	*/
    @Schema(description="生产经营地址")
    private String productionAddress;

	/**
	* 注册地址
	*/
    @Schema(description="注册地址")
    private String registeredAddress;

	/**
	* 经营范围
	*/
    @Schema(description="经营范围")
    private String businessScope;

	/**
	* 是否使用: 2 已启用 1 已停用
	*/
    @Schema(description="是否使用: 2 已启用 1 已停用")
    private Integer useStatus;

	/**
	* 是否监控: 2 已监控 1 未监控
	*/
    @Schema(description="是否监控: 2 已监控 1 未监控")
    private Integer monitorStatus;

	/**
	* 生产状态
	*/
    @Schema(description="生产状态")
    private Integer productionStatus;

	/**
	* 关注程度
	*/
    @Schema(description="关注程度")
    private String concernDegree;

	/**
	* 经度
	*/
    @Schema(description="经度")
    private String longitude;

	/**
	* 纬度
	*/
    @Schema(description="纬度")
    private String latitude;

	/**
	* 高度
	*/
    @Schema(description="高度")
    private String altitude;

	/**
	* 范围
	*/
    @Schema(description="范围")
    private String areaScope;

	/**
	* 环保负责人
	*/
    @Schema(description="环保负责人")
    private String environmentalUserId;

	/**
	* 联系方式
	*/
    @Schema(description="联系方式")
    private String contactWay;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	* 环保机构名称
	*/
    @Schema(description="环保机构名称")
    private String environmentalAgency;

	/**
	* 专职环保人员
	*/
    @Schema(description="专职环保人员")
    private String environmentalPersonnel;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	/**
	* 创建人
	*/
	@TableField(fill = FieldFill.INSERT)
    @Schema(description="创建人")
    private String createBy;
 
	/**
	* updateBy
	*/
	@TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description="updateBy")
    private String updateBy;
 
	/**
	* createTime
	*/
	@TableField(fill = FieldFill.INSERT)
    @Schema(description="createTime")
    private LocalDateTime createTime;
 
	/**
	* updateTime
	*/
	@TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description="updateTime")
    private LocalDateTime updateTime;

	/**
	* 删除标记，0未删除，1已删除
	*/
    @TableLogic
    @Schema(description="删除标记，0未删除，1已删除")
    private String delFlag;
 
	/**
	* tenantId
	*/
    @Schema(description="tenantId")
    private Long tenantId;


	public String getEnvironmentalUserIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_user, this.getEnvironmentalUserId());
	}

	public String getProductionStatusStr() {
		return DictResolver.getItemLabelByValue(PollSysDictEnum.poll_production_status, this.getProductionStatus());
	}

	public String getUseStatusStr() {
		return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.getUseStatus());
	}
	public String getMonitorStatusStr() {
		return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.getMonitorStatus());
	}

	public String getAreaScopeStr() {
		if (StringUtils.isBlank(this.getAreaScope())) {
			return "未定位";
		} else {
			return "已定位";
		}
	}

}